package com.green.di.dao.impl;

import com.green.di.dao.IPersonDao;
import com.green.di.entity.Person;
import org.springframework.stereotype.Repository;

import java.util.Arrays;
import java.util.List;

@Repository
public class PersonDaoImpl implements IPersonDao {
    @Override
    public int insertPerson() {
        System.out.println("添加用户");
        return 1;
    }

    @Override
    public int updatePerson() {
        System.out.println("修改用户");
        return 1;
    }

    @Override
    public int removePerson() {
        System.out.println("删除用户");
        return 1;
    }

    @Override
    public List<Person> searchPersonList() {
        Person person1 = new Person();
        person1.setId(1L);
        person1.setName("张三");

        Person person2 = new Person();
        person2.setId(1L);
        person2.setName("张三");
        return Arrays.asList(person1, person2);
    }

    @Override
    public Person searchPersonById() {
        Person person1 = new Person();
        person1.setId(1L);
        person1.setName("张三");
        return person1;
    }
}
